<template>
  <span
    class="text-primary cursor-pointer copy-text"
    v-clipboard:copy="text"
    v-clipboard:success="clipboardSuccess"
    >复制</span
  >
</template>
<script>
import { message } from "ant-design-vue";

export default {
  props: {
    text: {
      type: String,
      required: true,
    },
  },
  methods: {
    clipboardSuccess() {
      message.success("复制成功");
    },
  },
};
</script>
<style scoped>
.copy-text {
  margin-left: 5px;
  flex-shrink: 0;
}
</style>
